//
//  ViewController.swift
//  Clock
//
//  Created by jisa on 2020/4/28.
//  Copyright © 2020 jff. All rights reserved.
//

import UIKit

class ViewController: UIViewController {
    
    var timer:Timer!
    
    
    fileprivate var timerPanel:FFTimerPanelView!
    
    @IBOutlet weak var settingBtn: UIButton!
    override func viewDidLoad() {
        super.viewDidLoad()
        FFInit()
    }
    
    
    
    override func viewDidLayoutSubviews() {
        super.viewDidLayoutSubviews()
        timerPanel.frame = view.bounds
    }
    
    override var prefersStatusBarHidden: Bool {
        return true
    }

    fileprivate func FFInit() {
        timerPanel =  FFTimerPanelView()
        view.addSubview(timerPanel)
        timerPanel.FFStartTimer()
        view.bringSubviewToFront(settingBtn)
        let tap = UITapGestureRecognizer(target: self, action: #selector(FFAnimation))
        timerPanel.addGestureRecognizer(tap)
        UIApplication.shared.isIdleTimerDisabled = true
    }
    
    
    @IBAction func FFEntrySetting(_ sender: UIButton) {
        let nav:FFNavigationController = FFNavigationController(rootViewController: FFSettingViewController())
        navigationController?.present(nav, animated: true, completion: nil)
//        navigationController?.pushViewController(FFSettingViewController(), animated: true)
    }
    
    @objc fileprivate func FFAnimation() {
//        timerPanel.FFStartTimer()
    }
}


extension ViewController {
    override var preferredStatusBarStyle: UIStatusBarStyle {
        return UIStatusBarStyle.lightContent
    }
}
